import mySql from "../sql/index"
import {makePage} from "../utils/index"
export default {
	route: '/projectList',
	async handle(params){
		let res:any =  await mySql.query({
			tableName: 'list',
			condition(item){
				return true;
			}
		});
		return new Promise((resolve,reject)=>{
			if(res.code === 200 && res.data.length > 0){
				resolve({...res,data:makePage({
					pageSize: params.pageSize,
					pageNo: params.pageNo,
					list: res.data
				})});
			}else{
				resolve({...res,data:{list:[],total:0}});
			}
		})
	}
}